package com.qf.mapper;

import com.qf.model.ProAndDevCon;
import com.qf.model.Project;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;
import java.util.Map;

public interface ProjectMapper {
    @Select("select * from project where status =1")
    public List<Project> findAll();

    //当前页结果
//    @Select("select * from project where status=1 limit #{currentPage} ,#{pageSize} ")
    public List<Project> findPage(@Param("currentPage")Integer currentPage,@Param("pageSize")Integer pageSize,@Param("queryString")String queryString);


    //总记录数

    public Long count(String queryString);

    //添加一个project
    public int addOne(Project project);


    //根据pid查询project
    public Project findById(Integer pid);
    //修改project
    public int editOne(Project project);

    //逻辑删project
    int delete(Integer pid);

    //修改绑定开发商
    int bindDeveloper(Integer pid,String did);
    //修改绑定承建商
    int bindContractor(int pid, String cid);

    //根据cid查询project
    List<Project> findByCid(String cid);

    //根据did查询project
    List<Project> findByDid(String did);

    //取消绑定承建商,根据pid
//    int cancelBindContractor(int pid);

    //清空所有绑定对应cid的project的cid
    int cancelBindContractorByCid(String cid);

    //清空所有绑定对应did的project的did
    int cancelBindContractorByDid(String did);


    ProAndDevCon index(int pid);



}
